﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace rajitWorkTwo
{
    static class miscFunction
    {
        public static Boolean IsPointInside(workLog workLogOne, tool toolOne)
        {
            int toolCrossSection = 1;

            Vector2 position = workLogOne.position;
            position.X -= workLogOne.sprite.Width / 2;
            position.Y -= workLogOne.sprite.Height / 2;

            Vector2 point = new Vector2(toolOne.position.X - (toolOne.sprite.Width / 2), toolOne.position.Y - (toolOne.sprite.Height / 2));

            Boolean truthX = false;
            Boolean truthY = false;

            if (point.X >= position.X && point.X <= (position.X + gVar.workLogPixelWidth - toolOne.sprite.Width))
                truthX = true;

            if (point.Y >= position.Y && point.Y <= (position.Y + gVar.workLogPixelHeight - toolCrossSection))
                truthY = true;

            return (truthX && truthY);
        }


    }
}
